import request from "@/utils/request";
import qs from "qs";
//以下为省调平衡分析
// 全网平衡裕度
export function getBalanceMargin(data) {
  return request({
    url: "/main/main/getBalanceMargin",
    method: "post",
    data: data,
  });
}
//正备用、负备用、全天最小负备用
export function getMapstanby(data) {
  return request({
    url: "/main/main/getMapstanby",
    method: "post",
    data: data,
  });
}


//分区供电裕度
export function getFqgdmargin(data) {
  return request({
    url: "/main/main/getFqgdmargin",
    method: "post",
    data: data,
  });
}
//分区供电裕度
export function getGjpass(data) {
  return request({
    url: "/main/main/getGjpass",
    method: "post",
    data: data,
  });
}
//设备过载个数
export function overloadDevices(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/overloadDevices",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


//五大直流
export function getFiveDirectCurrent(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getFiveDirectCurrent",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

//安徽浙江上海的数据
export function getAhZejShData(data) {
  return request({
    url: "/main/main/getAhZejShData",
    method: "post",
    data: data,
  });
}
//地区需求信息
export function areaApplyInfo(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/areaApplyInfo",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

//以下为业务流程接口
//省调需求
export function getSdList() {
  return request({
    url: "/xtxt/xtxt/getSdList",
    method: "get",
  });
}
//需求信息
export function getNeedList(data) {
  return request({
    url: "/xtxt/xtxt/getNeedList",
    method: "post",
    data: data,
    // headers: {
    //   "Content-Type": "application/json;charset=UTF-8",
    // },
  });
}
//地调校核
export function getDdcheckList(data) {
  return request({
    url: "/xtxt/xtxt/getDdcheckList",
    method: "post",
    data: data,

  });
}
//地调校核结果
export function getCheckResult(data) {
  return request({
    url: "/xtxt/xtxt/getCheckResult",
    method: "post",
    data: data,
  });
}



// //储能上调下调
// export function getEnergyStorage(data) {
//   const formData = qs.stringify(data);
//   return request({
//     url: "/main/main/getEnergyStorage",
//     method: "post",
//     headers: {
//       "Content-Type": "application/x-www-form-urlencoded",
//     },
//     data: formData,
//   });
// }


//可调负荷上调下调
export function getAdjustableLoad(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getAdjustableLoad",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}
//虚拟电厂上调下调
export function getVirtualPowerPlant(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getVirtualPowerPlant",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


//非统调上调下调
export function getNonAlignedMovement(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getNonAlignedMovement",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


//深调峰
export function scalar(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/scalar",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

//统调机组
export function unifiedUnit(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/unifiedUnit",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


//非统调新能源、调度分布式
export function adjustDistributed(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/adjustDistributed",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



//统调新能源
export function adjustNewEnergy(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/adjustNewEnergy",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

//储能
export function getEnergyStorage(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getEnergyStorage",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}







// 业务流程模块的接口

export function getAdjustment(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getAdjustment",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}




// 可调节资源

export function getAdjustableResources(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getAdjustableResources",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}




// 分类型可调节能力

export function getAdjustableClassification(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getAdjustableClassification",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 调整策略---调节能力-量-负备用接口
export function getAdjustmentNl(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getAdjustmentNl",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}




// 总加的接口
export function getSum(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getSum",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 调整策略---最大时刻+电力
export function getMaxTimeAndDl(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/main/main/getMaxTimeAndDl",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 调整策略---最大时刻+电力
// export function getMaxTimeAndDl(data) {
//   const formData = qs.stringify(data);
//   return request({
//     url: "/main/main/getMaxTimeAndDl",
//     method: "post",
//     headers: {
//       "Content-Type": "application/x-www-form-urlencoded",
//     },
//     data: formData,
//   });
// }




// 下面是地调部分的接口
// 全天最严重设备
export function seriousDevice(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/seriousDevice",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 根据设备id绘制越限曲线
export function getYxPoints(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/getYxPoints",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 时间轴
export function timeAxis(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/timeAxis",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}





// 根据地区id获取设备越限信息
export function getYxInfoByDvId(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/getYxInfoByDvId",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 某一时刻最严重
// export function momentSerious(data) {
//   const formData = qs.stringify(data);
//   return request({
//     url: "/momentSerious",
//     method: "post",
//     headers: {
//       "Content-Type": "application/x-www-form-urlencoded",
//     },
//     data: formData,
//   });
// }

export function momentSerious(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/momentSerious",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 风险详情
export function riskDetail(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/riskDetail",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}




// 网测调整
export function netSideAdjust(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/netSideAdjust",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 储能-负荷侧调整
export function storageLoadAdjust(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/storageLoadAdjust",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 调整策略数据来源
export function adjustment(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustment",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 主变资源统计
export function statistics(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/statistics",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 调整结果
export function adjustResult(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/newAdjustResult",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}





// 信息需求概览
export function infoNeedView(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/infoNeedView",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 省调需求
export function provinceNeed(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/provinceNeed",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 地调校核详情
export function checkDetail(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/checkDetail",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 统计11个区的设备正反向过载数
export function dvStatistics(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/dvStatistics",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 新能源曲线绘制
export function newEnergyCurve(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/newEnergyCurve",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 根据设备ID获取信息
export function getInfoByDvId(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/getInfoByDvId",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 调节资源模块接口部分





// 可调节资源
export function adjustResource(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustResource",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



//可调节资源----时间轴
export function adjustResourceByTime(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustResourceByTime",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}





// 分类型可调节能力
export function adjustResourceAbility(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustResourceAbility",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 分类型可调节能力时间轴版本
export function adjustResourceAbilityByTime(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustResourceAbilityByTime",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 地图板块  不加时间版本
export function adjustResourceMap(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustResourceMap",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 地图板块  加时间版本

export function adjustResourceMapByTime(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustResourceMapByTime",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 分类型可调节能力------折线图
export function adjustResourceAbilityByLine(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustResourceAbilityByLine",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 地图板块折线图

export function mapForLine(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/mapForLine",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 校核未校核详情
export function checkNotPassInfo(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/checkNotPassInfo",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 地调校核详情曲线
export function checkDetailCurve(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/checkDetailCurve",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 单条越限信息的调节资源页面
// 地调校核详情曲线


// 平衡调整结果
export function dtyx_analysisAdjustmentStrategy(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/analysisAdjustmentStrategy",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 调整策略
export function dtyx_adjustmentStrategy(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustmentStrategy",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 时间轴颜色
export function dtyx_timeAxis(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustment/timeAxis",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 调整策略需求曲线
export function dtyx_strategy(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustment/strategy",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}

// 结构图
export function dtyx_structuralDiagram(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/structuralDiagram",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 结构图-时间轴
export function dtyx_structuralDiagramByTime(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/structuralDiagramByTime",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 资源单体详情
export function resourceUnitDetail(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/resourceUnitDetail",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}


// 资源单体曲线图
export function resourceUnitDiagram(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/resourceUnitDiagram",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}



// 批量根据设备ID查询OP映射相关信息
export function opInfoQueryBatch(data) {
  // const formData = qs.stringify(data);
  return request({
    url: "/gridMap/opInfoQueryBatch",
    method: "post",
    // headers: {
    //   "Content-Type": "application/x-www-form-urlencoded",
    // },
    data: data,
  });
}




// 门槛值
export function get_threshold(data) {
  const formData = qs.stringify(data);
  return request({
    url: "/adjustment/threshold",
    method: "post",
    headers: {
      "Content-Type": "application/x-www-form-urlencoded",
    },
    data: formData,
  });
}




